import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import {createHtmlPlugin} from "vite-plugin-html";

export default defineConfig (({mode}) => ({
  plugins: [react(),
    createHtmlPlugin({
    inject: {
      data: { MODE: mode, HASH: Date.now() },
    },
  }),],
  server: {
    host: '127.0.0.1',
    port: 5371,
    proxy: {
      '/api': {
        target: '',
        changeOrigin: true,
      },
    },
    open: true,
  },
}))
